package com.simon.hse.activity.safe.jobticket.pipeline;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.simon.hse.MyApplication;
import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 管线作业许可证申请
 */
@SuppressWarnings("all")
@ContentView(R.layout.activity_apply_pipeline)
public class PipelineApplyActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;

    @ViewInject(R.id.ll_workunit)
    LinearLayout ll_workunit;
    @ViewInject(R.id.tv_workunit)
    TextView tv_workunit;

    @ViewInject(R.id.ll_territorial_department)
    LinearLayout ll_territorial_department;
    @ViewInject(R.id.tv_territorial_department)
    TextView tv_territorial_department;

    @ViewInject(R.id.ll_work_area)
    LinearLayout ll_work_area;
    @ViewInject(R.id.tv_work_area)
    TextView tv_work_area;

    @ViewInject(R.id.ll_work_location)
    LinearLayout ll_work_location;
    @ViewInject(R.id.tv_work_location)
    TextView tv_work_location;

    @ViewInject(R.id.ll_start_time)
    LinearLayout ll_start_time;
    @ViewInject(R.id.tv_start_time)
    TextView tv_start_time;

    @ViewInject(R.id.ll_end_time)
    LinearLayout ll_end_time;
    @ViewInject(R.id.tv_end_time)
    TextView tv_end_time;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mTv_common_title.setText("管线作业许可证申请");
    }

    @Event(value = {R.id.iv_common_left, R.id.iv_common_right
            ,R.id.ll_workunit,R.id.ll_territorial_department,R.id.ll_work_area,R.id.ll_work_location, R.id.ll_start_time, R.id.ll_end_time})
    private void back(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
            case R.id.ll_workunit:
                initSafePop(ll_workunit, tv_workunit, MyApplication.getInstance().mSafeNullList);
                break;
            case R.id.ll_territorial_department:
                initSafePop(ll_territorial_department, tv_territorial_department, MyApplication.getInstance().mSafeNullList);
                break;
            case R.id.ll_work_area:
                initSafePop(ll_work_area, tv_work_area, MyApplication.getInstance().mSafeNullList);
                break;
            case R.id.ll_work_location:
                initSafePop(ll_work_location, tv_work_location, MyApplication.getInstance().mSafeNullList);
                break;
            case R.id.ll_start_time:
                publishSafeDate(tv_start_time);
                break;
            case R.id.ll_end_time:
                publishSafeDate(tv_end_time);
                break;
        }
    }
}
